import glob
import csv


# Merge cvs tables: put the cvs files in a folder, read them all, copy every row to a new output file

# Open result file
with open('../output.csv','wb') as fout:
    wout = csv.writer(fout,delimiter='\t') 
    interesting_files = sorted(glob.glob("*.csv")) 
    for filename in interesting_files: 
        print 'Processing',filename 
        # Open and process file
	with open(filename,'rb') as fin:
       	        fin.next()#skip header
		for line in csv.reader(fin,delimiter='\t'):
       			wout.writerow(line)



